<%-- 
    Document   : PaymentForRegister
    Created on : Sep 4, 2013, 2:35:20 PM
    Author     : ChauAnh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Payment</title>
        <%@page import="java.util.HashMap"%>
        <%@page import="java.util.Iterator"%>
        <%@page import="java.util.Set"%>
        <%@page import="java.text.SimpleDateFormat"%>
        <%@page import="java.util.Date"%>
    </head>
    <body>
        <%
            /*HashMap hm = (HashMap) request.getSession().getAttribute("Charges_data");
             Set charge = hm.keySet();
             Iterator itr = charge.iterator();*/
            HttpSession ss = request.getSession(true);
            if (ss.getAttribute("login") == null) {
                response.sendRedirect("index.jsp");
            } else {
                HashMap hm = (HashMap) request.getSession().getAttribute("Charges_data");
                Set charges = hm.keySet();
                Iterator itr = charges.iterator();

                Date today = new Date(System.currentTimeMillis());
                SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
                String todayStr = dateFormat.format(today.getTime());
                String username = (String) request.getSession().getAttribute("login");
        %>   
        <div align="center">
            <div align="center" style="height: auto; width: 800px">
                <jsp:include page="master.jsp" flush="true"/>                
            </div>            
            <div align="center" style="height: 100%; width: 800px">                     
                <table border="0" width="70%">
                    <tr>
                        <td valign="top" width="30%">                    
                        </td>
                        <td>    <form name="frmCharge" method="POST" action="PaymentRegister">                
                                <table border="0">
                                    <thead>
                                        <tr>
                                            <th colspan="2" align="left" class="text-lager-title-reb" style="padding-top: 5px; padding-bottom: 10px;">Payment</th>                                
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td class="text-nomarl-title-reb" align="left">Charge ID:</td>
                                            <td align="left"><select name="ddlChargeID" class="gwt-Combobox-Register">
                                                    <%
                                                        while (itr.hasNext()) {
                                                            Object keyid = itr.next();
                                                            HashMap hm2 = (HashMap) hm.get(keyid);
                                                    %>
                                                    <option value="<%= hm2.get("id_charges")%>"><%= hm2.get("duration")%></option>
                                                    <%
                                                        }
                                                    %>
                                                </select></td>
                                        </tr>
                                        <tr>
                                            <td class="text-nomarl-title-reb" align="left">Username:</td>
                                            <td align="left"><input type="text" name="txtUserid" value="<%out.println(username);%>" readonly="readonly" class="gwt-TextBox-Register"/></td>
                                        </tr>
                                        <tr>
                                            <td class="text-nomarl-title-reb" align="left">Date:</td>
                                            <td align="left"><input type="text" name="txtDate" value="<%out.println(todayStr);%>" readonly="readonly" class="gwt-TextBox-Register"/></td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="text-nomarl-title-reb">Card No.:</td>
                                            <td align="left"><input type="text" name="txtCardNo" value="" class="gwt-TextBox-Register"/></td>
                                        </tr>
                                        <tr>
                                            <td align="left" class="text-nomarl-title-reb">Card Type:</td>
                                            <td align="left"><select name="ddlCardType" class="gwt-Combobox-Register">
                                                    <option>Visa</option>
                                                    <option>Master Card</option>
                                                    <option>ATM</option>
                                                </select></td>
                                        </tr>
                                        <tr>
                                            <td></td>
                                            <td align="left"><input type="submit" value="Submit" class="gwt-Button-Register" /></td>
                                        </tr>
                                    </tbody>
                                </table> </form>                   
                        </td>
                    </tr>
                </table>
            </div>     
        </div>
        <%}%>
    </body>
</html>
